import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PreloadStrategyService } from './providers/preload-strategy.service';
// prefix / full  loadChildren: () => import('./page/publish/publish.module').then(mod => mod.PublishModule)
const routes: Routes = [
    {path: '', redirectTo: '/task' , pathMatch: 'full'},
    {path: 'task', loadChildren: () => import('./page/task/task.module').then(mod => mod.TaskModule), data: { preload: true}},
    {path: 'publish', loadChildren: () => import('./page/publish/publish.module').then(mod => mod.PublishModule)},
    {path: 'self', loadChildren: () => import('./page/self/self.module').then(mod => mod.SelfModule)}
];

@NgModule({
    imports: [RouterModule.forRoot(routes, {
        preloadingStrategy: PreloadStrategyService
    })],
    exports: [RouterModule]
})
export class AppRoutingModule { }
